home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr52
/
expand53.zip
/
XPNGDEMO.ZIP
/
NGPRINT.PRG
< prev
next >
Wrap
Text File
|
1992-08-18
|
2KB
|
109 lines
* ------------------------------------------------------------------------
* File........: NGPRINT.PRG
* Author......: Pepijn Smits
* Copyright...: (c)1992, by "Softwarebureau Pepijn Smits", Rotterdam.
* Date........: August 1992
* Compile.....: Clipper 5.01, Compile with /m /l /n /v
* Notes.......: Norton Guides Printer: Very Very Simple Norton Guides Printer
* Use redirection (> or >>) for printing to File/Printer.
* ------------------------------------------------------------------------
#include "SIMPLEIO.CH"
#xtranslate OutLine( <s> ) => OutStd( <s> + chr(13)+chr(10))
#xtranslate FormFeed() => Chr(12)
#xtranslate HorizLine() => Replicate('─',78)
Procedure Main()
Local cNG := Upper(Alltrim(XPcommandLine()))
Local i,j
?? "Norton Guides Printer, written by Pepijn Smits using EXPAND.LIB"
?
if At('.NG',cNG)==0
cNG+=".NG"
end
cNG := XPqualify(cNG)
if Empty(cNG)
? "Error: file not found"
?
quit
end
if !NGopen(cNG)
? "Error: specified doesn't seem to be a Norton Guide database"
?
quit
end
? "Printing `"+NGname()"'"
? "Norton Guide printed using the Expand Library for Clipper 5.01"
?
?
?
? PadC("Database Credits",78)
?
aEval(NGcredit(),{|s|OutLine(Space(8)+s)})
?
?
?
?
?
?
if NGmenus() == 0
// If there are no menus, then the Guide starts at 378..
PrintEntry(378)
else
for i := 1 to NGmenus()
for j := 1 to NGmenuCount(i)
? FormFeed()
? "Menu: " + NGmenuTitle(i) + " » " + NGmenuLabel(i,j)
?
?
PrintEntry(NGmenuEntry(i,j))
next
next
end
NGclose()
?
?
?
quit
Return
Function PrintEntry(nEntry)
Local nType := NGtype(nEntry)
if nType == 0
PrintShort(nEntry)
elseif nType == 1
PrintLong(nEntry)
else
? "Error: It seems the Norton Guide contains an Error!"
end
Return (NIL)
Function PrintLong(nEntry)
Local aLong := NGlong(nEntry)
Local aSeeAlso := NGseeAlso(nEntry)
?
aEval(aLong,{|s|OutLine(s)})
?
if aSeeAlso <> NIL
? "See Also: "
aEval(aSeeAlso,{|e|OutStd('"'+e[1]+'" ')})
?
?
end
Return (NIL)
Function PrintShort(nEntry)
Local aShort := NGshort(nEntry)
Local i
?
For i := 1 to Len(aShort)
? aShort[i][1]
if aShort[i][2] > 0
// Got an antry under this one...
? HorizLine()
PrintEntry(aShort[i][2])
? HorizLine()
end
next
Return (NIL)